<h3>Registration</h3>


<form xmlns:th="http://www.thymeleaf.org" action="authentication"
	th:action="@{/guest/registeruser}" th:object="${user}" method="post"
	class="well">


	<div class="alert alert-success" th:if="${user.id !=null}">
		<strong>Well done!</strong> Registration completed successfully. <br />Check
		your email and follow the instructions to activate the user/account.
	</div>


	<fieldset>
		<table style="width: 100%">

			<tr class="control-group"
				th:class="${#fields.hasErrors('company.name')} ? 'control-group error' : 'control-group'">
				<td class="inputLabel"><label>Company </label></td>
				<td class="controls"><input type="text"
					th:field="*{company.name}" required="required"
					th:disabled="${user.id !=null}" autofocus="autofocus"
					class="input span9" placeholder="Company Name" /> <span
					class="help-inline error"
					th:if="${#fields.hasErrors('company.name')}"
					th:errors="*{company.name}">Name is required.</span></td>

			</tr>

			<tr class="control-group"
				th:class="${#fields.hasErrors('firstName')} ? 'control-group error' : 'control-group'">
				<td class="inputLabel"><label>First Name </label></td>
				<td><input type="text" th:field="*{firstName}"
					th:disabled="${user.id !=null}" autofocus="autofocus"
					class="input span9" placeholder="First Name" required="required" />
					<span class="help-inline error"
					th:if="${#fields.hasErrors('firstName')}" th:errors="*{firstName}">First
						Name is required.</span></td>
			</tr>

			<tr>
				<td class="inputLabel"><label>Last Name </label></td>
				<td><input type="text" th:field="*{lastName}"
					th:disabled="${user.id !=null}" autofocus="autofocus"
					class="input span9" placeholder="Last Name"></input></td>
			</tr>

			<tr class="control-group"
				th:class="${#fields.hasErrors('email')} ? 'control-group error' : 'control-group'">
				<td class="inputLabel"><label>Username/Email </label></td>
				<td class="controls"><input type="text" th:field="*{email}"
					th:disabled="${user.id !=null}" autofocus="autofocus"
					class="input span9" required="required"
					placeholder="Username / E-mail" /> <span class="help-inline error"
					th:if="${#fields.hasErrors('email')}" th:errors="*{email}">Email
						is required.</span></td>
			</tr>

			<tr
				th:class="${#fields.hasErrors('password')} ? 'control-group error' : 'control-group'">
				<td class="inputLabel"><label>Password </label></td>
				<td class="controls"><input type="password"
					th:field="*{password}" th:disabled="${user.id !=null}"
					autofocus="autofocus" class="input span9" placeholder="Password"
					required="required" /> <span class="help-inline error"
					th:if="${#fields.hasErrors('password')}" th:errors="*{password}">Password
						is required.</span></td>
			</tr>


		</table>

	</fieldset>
	<div class="form-actions">
		<button type="submit" class="btn btn-success"
			th:disabled="${user.id !=null}">Register</button>
		<button type="reset" class="btn btn-info"
			th:disabled="${user.id !=null}">Cancel</button>
	</div>
</form>